home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
mcu332
/
332src.arc
/
RESETV.SA
< prev
Wrap
Text File
|
1990-05-02
|
26KB
|
496 lines
** Set checksum at "CHECKVAL" below! **
TTL Reset Vector and Code Size
OPT P=68332
******************************************************************************
** Exported portion ***
*V****************************************************************************
*** ***
*** MODULE: ***
*** RESETV - This module contains the reset vector for the system. ***
*** It also includes a longword that contains the size of ***
*** the code segment in bytes and all of the user custom- ***
*** ization parameters. ***
*** ***
*** ENVIRONMENT: ***
*** MC68332 BCC EVM system ***
*** ***
*** LANGUAGE: ***
*** M68MASM for MS-DOS MC68332 assembly language relocatable module ***
*** ***
*** SUMMARY OF CONTENTS: ***
*** <will be linked to start at $60000 for BCC> ***
*** System reset vector. ***
*** Code segment size. ***
*** User customization parameters. ***
*** ***
*** NOTES: ***
*** 1. Source equivalent copy of 332Bug parameter area for Motorola ***
*** FREEWARE Bulletin Board System (BBS) to produce object ***
*** equivalent code. See REVISION HISTORY below for version nbr. ***
*** 2. This source code can be freely used at no cost/obligation, ***
*** i.e. it is PUBLIC DOMAIN software. Please report any errors/ ***
*** additions to the SYSOP of the Motorola FREEWARE BBS. ***
*** 3. Parameters which reference linker symbols (XREF/XDEF) will ***
*** not be defined until link time, so the obj. code listed here ***
*** will not match the actual EPROM code. ***
*** ***
*^****************************************************************************
*** INTERNAL PORTION OF THE MODULE HEADER ***
******************************************************************************
*** ***
*** REVISION HISTORY (add changes to the top): ***
*** ***
*** DATE AUTHOR CHANGES ***
*** ---------- --------------- ------------------------------------- ***
*** 01/16/90 Peter S. Gilmour Initial version port to MS_DOS based ***
*** M68MASM from original source code. ***
*** Compatible with 332Bug version 1.01. ***
*** 05/02/90 Peter S. Gilmour Compatible with 332Bug version 1.02. ***
*** ***
******************************************************************************
*** ***
*** XDEFS: ***
*** ***
XDEF ORIGIN Start of program space
XDEF CODESIZE Size of program space in bytes
XDEF CHECKSUM Permit access by confidence test
* Old CSn base addr reg. values
XDEF .CSBAR0,.CSBAR1,.CSBAR2,.CSBAR3,.CSBAR4,.CSBAR5
XDEF .CSBAR6,.CSBAR7,.CSBAR8,.CSBAR9,.CSBAR10
* Old CSn base addr reg. values
XDEF .CSOR0,.CSOR1,.CSOR2,.CSOR3,.CSOR4,.CSOR5
XDEF .CSOR6,.CSOR7,.CSOR8,.CSOR9,.CSOR10
* Common CSBOOT values
XDEF .CSBARBT Old/new CSBOOT base addr reg. value
XDEF .CSORBT Old/new CSBOOT option reg. value
* New CSn base addr reg. values
XDEF CSBAR0$,CSBAR1$,CSBAR2$,CSBAR3$,CSBAR4$,CSBAR5$
XDEF CSBAR6$,CSBAR7$,CSBAR8$,CSBAR9$,CSBAR10$
* New CSn base addr reg. values
XDEF CSOR0$,CSOR1$,CSOR2$,CSOR3$,CSOR4$,CSOR5$
XDEF CSOR6$,CSOR7$,CSOR8$,CSOR9$,CSOR10$
XDEF .RAMMCR RAM Config. Reg. value
XDEF .RAMBAR RAM Base Addr. Reg. value
XDEF .PICR Periodic interrupt control reg. value
XDEF .PITR Periodic interrupt timer reg. value
XDEF RB_SP Rom Auto Boot SP location in ROM
XDEF RB_PC Rom Auto Boot PC location in ROM
XDEF CONSCI Console default SCI parameter table
XDEF .PARMS SCI parameter definition
XDEF .BAUD SCI baud rate value
XDEF .PARITY SCI parity value
XDEF .DATA SCI nbr. data bits value
XDEF .STOP SCI nbr. stop bits value
XDEF .XON_ENB SCI XON/XOFF enable value
XDEF .XON SCI XON value
XDEF .XOFF SCI XOFF value
XDEF PWR_ON Start of Power on branch vectors
XDEF PWR_INI MCU init. Power on branch vector
XDEF PWR_TTL Sign on title Power on branch vector
XDEF PWR_TST Self-test Power on branch vector
XDEF PWR_GO System Go Power on branch vector
XDEF SYSPATCH System patch area
XDEF SIGNON Offset to system sign on message text
*** ***
*** XREFS: ***
*** ***
XREF CONFTST Confidence test entry point
XREF SYSINIT Start of program (system init.)
XREF INIT_CS MCU initialization (chip selects, etc.
XREF MEMPAGE 16 Megabyte page
*** ***
*** Local macros: ***
*** ***
VECTOR MACRO ! SETUP VECTOR SPACE
SECTD SET 0 ! DEFINE DATA SECTION
SECTP SET 8 ! DEFINE PROGRAM SECTION
SECTION SECTP ! PUT USER INTO PROG. SECTION
ENDM !
***
*** Local equates:
***
CR EQU $0D ASCII carriage return
LF EQU $0A ASCII line feed
SPACE EQU $20 ASCII space
*
* For M68332 BCC and PFB.
*
* NOTE: Unused upper address lines are specified as 1's so ABSOLUTE SHORT
* addressing (sign extension) can be used.
*
SR_VAL EQU $2700 status register initial value.
RAM_BASE EQU $0 BCC RAM base address
RAM_SIZE EQU $10000 BCC RAM size (bytes)
ROM1_BASE EQU $60000 BCC EPROM base address
ROM1_SIZE EQU $20000 BCC EPROM size (bytes)
IRAM_BASE EQU $40000
FPCP_BASE EQU $FFFFE800 PFB MC68881/MC6882 base address
* . (Floating Point Co-Processor)
SIM EQU $FFFFFA00 BCC M68332 System Integration Module base addr
RAMCR EQU $FFFFFB00 BCC M68332 RAM Control Module base address
AUTO_BASE EQU $FFFFF800 Autovector base address
LOCALRAM EQU RAM_BASE base of local RAM
SYSRAMSZ EQU $00004000 size of local RAM (for system use)
LCLRAMMX EQU RAM_SIZE max size of local RAM (for M68332 BCC)
USRRAM EQU LOCALRAM+SYSRAMSZ base of user RAM
USRRAMSZ EQU LCLRAMMX-SYSRAMSZ size of user RAM
RAMSTART EQU LOCALRAM alias for base of local RAM
LOCALROM EQU ROM1_BASE base of local ROM (use PC rel refs!)
LCLROMSZ EQU $00010000 size of local ROM used by 332Bug
ROMUNPGM EQU $FF unprogrammed state of a byte of EPROM
FILL.1 EQU ROMUNPGM fill value for 1 byte = BYTE
FILL.2 EQU FILL.1<<8+FILL.1 fill value for 2 bytes= WORD
FILL.4 EQU FILL.2<<16+FILL.2 fill value for 4 bytes= LONG WORD
RAM2_BASE EQU LOCALRAM+LCLRAMMX Next RAM base address
ROM2_BASE EQU ROM1_BASE+ROM1_SIZE Next ROM base address
VECTSIZ EQU $400 Vector table size
USERLEN EQU $1000 user space reserved
MEMINC EQU $4000 memory increment for 130's or EVM's
STKLEN EQU MEMINC-USERLEN-VECTSIZ-4 size of bug/diag stack + static vars
*
* Interrupt levels & vectors
*
ABORTLVL EQU 7 abort level
ABORTVEC EQU 31 abort vector
ACFAILVL EQU 7 AC-Fail level
ACFAILVC EQU 65 AC-Fail vector
TIMERLVL EQU 6 timer level: M68332 periodic int. timer
TIMERVEC EQU 66 timer vector
*
* Setup Base Addresses:
* 1. A31-A24 must= 0 (MC68332 only uses A0-A23; rest are unused!)
* 2. A10-A0 must= 0 (for Base Address Register usage).
*
ADDRMASK EQU $00FFF800 Address mask (24-bits, A10-A0= 0)
RAM EQU RAM_BASE&ADDRMASK Setup Base Addresses
ROM EQU ROM1_BASE&ADDRMASK Setup Base Addresses
RAM2 EQU RAM2_BASE&ADDRMASK Setup Base Addresses
ROM2 EQU ROM2_BASE&ADDRMASK Setup Base Addresses
FPCP EQU FPCP_BASE&ADDRMASK Setup Base Addresses
IRAM EQU IRAM_BASE&ADDRMASK Setup Base Addresses
AVEC_7 EQU AUTO_BASE&ADDRMASK Setup Base Addresses
CSBAR_XX EQU $0000 Reset (unused) value for CSBARn
CSOR_XX EQU $0000 Reset (unused) value for CSORn
*
* Option Register Equates (CSORBT, CSORn):
*
B2K EQU 0 2K block size
B8K EQU 1 8K block size
B16K EQU 2 16K block size
B64K EQU 3 64K block size
B128K EQU 4 128K block size
B256K EQU 5 256K block size
B512K EQU 6 512K block size
B1M EQU 7 1MB block size
ASYNC EQU $0000 Asynchronous mode
SYNC EQU $8000 Synchronous mode
CS_UPPB EQU 2*$2000 Upper byte
CS_LOWB EQU 1*$2000 Lower byte
CS_BOTHB EQU 3*$2000 Both bytes (upper or lower)
CS_R EQU 1*$800 Read
CS_W EQU 2*$800 Write
CS_RW EQU 3*$800 Read or write
CS_AS EQU 0*$400 Address Strobe (AS*)
CS_DS EQU 1*$400 Data Strobe (DS*)
CS_FAST EQU 14 Fast termination DSACK*
CS_EXT EQU 15 External termination DSACK*
CS_WAIT EQU 1*$40 Wait cycles for DSACK*
CS_CSP EQU 0*$10 CPU space
CS_USP EQU 1*$10 User space
CS_SSP EQU 2*$10 Supervisor space
CS_SUSP EQU 3*$10 Supervisor/User space
CS_LVL EQU 1*$2 Interrupt priority level
CS_AVEC EQU 1 Autovector enable
* Select value for checksum below:
* - place "*" in front of the one you DON'T want assembled
*
*CHECKVAL EQU FILL.2 Checksum value for debugging
CHECKVAL EQU $B930 Checksum value for finished product
* . - must not be same as FILL.2!
* The actual value of the checksum word is not known at the time
* that this file is assembled or linked. However, an "intelligent"
* checksum method is used whereby the program tells the user what
* the checksum should be if the checksum hasn't been programmed yet!
* Make the change, re-make the program, and blow new EPROM.
*
* The checksum word consists of two bytes that are placed at offset
* locations $0E-0F in the Bug EPROM and is used during execution of
* the confidence check to validate the EPROM contents.
*
********************************
** Configuration Parameters **
********************************
* DO NOT ALTER! Must match with user documentation!
*
VECTOR
*
ORIGIN EQU *
PWR_SSP DC.L LOCALRAM+VECTSIZ+STKLEN Init. SSP = below user ram
PWR_PC DC.L PWR_ON Init. PC = power on branch vector
**
CODESIZE DC.L ROM1_SIZE Set Code Size (in bytes)
CHECKALT DC.W FILL.2 -- reserved -- (alternate checksum)
CHECKSUM DC.W CHECKVAL Allocate space for checksum word
* . If CHECKVAL = FILL.2, then change
* . value of CHECKALT location!
* NOTE: "/256" is used in the Chip Select Tables below to shift address bits
* A23-A11 to bit positions B15-B3 (23-15= 8 bits = 256) for use in the
* SIM Base Address Registers.
* Old Chip Select Table: (Rev. A BCC + Rev. A PFB)
*
.CSBAR0 DC.W RAM/256+B64K CS0 base & option register values
.CSOR0 DC.W 0*CS_WAIT+CS_UPPB+CS_RW+CS_AS+CS_SUSP
.CSBAR1 DC.W RAM/256+B64K CS1 base & option register values
.CSOR1 DC.W 0*CS_WAIT+CS_LOWB+CS_RW+CS_AS+CS_SUSP
.CSBAR2 DC.W RAM2/256+B64K CS2 base & option register values
.CSOR2 DC.W 1*CS_WAIT+CS_BOTHB+CS_R+CS_AS+CS_SUSP
.CSBAR3 DC.W RAM2/256+B64K CS3 base & option register values
.CSOR3 DC.W 0*CS_WAIT+CS_LOWB+CS_W+CS_AS+CS_SUSP
.CSBAR4 DC.W ROM2/256+B128K CS4 base & option register values
.CSOR4 DC.W 1*CS_WAIT+CS_UPPB+CS_RW+CS_AS+CS_SUSP
.CSBAR5 DC.W ROM2/256+B128K CS5 base & option register values
.CSOR5 DC.W 1*CS_WAIT+CS_LOWB+CS_RW+CS_AS+CS_SUSP
.CSBAR6 DC.W FPCP/256+B2K CS6 base & option register values
.CSOR6 DC.W CS_EXT+CS_BOTHB+CS_RW+CS_AS+CS_SUSP
.CSBAR7 DC.W CSBAR_XX CS7 base & option register values
.CSOR7 DC.W CSOR_XX . -- unused --
.CSBAR8 DC.W AVEC_7/256 CS8 base & option register values
.CSOR8 DC.W 0*CS_WAIT+CS_BOTHB+CS_R+CS_AS+CS_CSP+7*CS_LVL+CS_AVEC
.CSBAR9 DC.W CSBAR_XX CS9 base & option register values
.CSOR9 DC.W CSOR_XX . -- unused --
.CSBAR10 DC.W RAM2/256+B64K CS10 base & option register values
.CSOR10 DC.W 0*CS_WAIT+CS_UPPB+CS_W+CS_AS+CS_SUSP
* Common Chip Select Table: (Rev. A BCC + Rev. A PFB) & (Rev. B BCC + Rev. B PFB)
*
.CSBARBT DC.W ROM/256+B128K CSBOOT base & option register values
.CSORBT DC.W 2*CS_WAIT+CS_BOTHB+CS_R+CS_AS+CS_SUSP
* - "2*CS_WAIT" = 2 wait cycles = AMD 27C1024-205LC 200 ns EPROM
* This EPROM is 2 wait cycles because it is always enabled, whereas the
* EPROM on the platform board (PFB) must first be enabled so it requires
* 3 wait cycles!
* New Chip Select Table: (Rev. B BCC + Rev. B PFB)
*
CSBAR0$ DC.W RAM/256+B64K CS0 base & option register values
CSOR0$ DC.W CS_FAST+CS_UPPB+CS_W+CS_AS+CS_SUSP
CSBAR1$ DC.W RAM/256+B64K CS1 base & option register values
CSOR1$ DC.W CS_FAST+CS_LOWB+CS_W+CS_AS+CS_SUSP
CSBAR2$ DC.W RAM/256+B64K CS2 base & option register values
CSOR2$ DC.W CS_FAST+CS_BOTHB+CS_R+CS_AS+CS_SUSP
CSBAR3$ DC.W CSBAR_XX CS3 base & option register values
CSOR3$ DC.W CSOR_XX . -- unused --
CSBAR4$ DC.W AVEC_7/256 CS4 base & option register values
CSOR4$ DC.W 0*CS_WAIT+CS_BOTHB+CS_R+CS_AS+CS_CSP+7*CS_LVL+CS_AVEC
CSBAR5$ DC.W FPCP/256+B2K CS5 base & option register values
CSOR5$ DC.W CS_EXT+CS_BOTHB+CS_RW+CS_AS+CS_SUSP
CSBAR6$ DC.W ROM2/256+B128K CS6 base & option register values
CSOR6$ DC.W 3*CS_WAIT+CS_LOWB+CS_RW+CS_AS+CS_SUSP
CSBAR7$ DC.W ROM2/256+B128K CS7 base & option register values
CSOR7$ DC.W 3*CS_WAIT+CS_UPPB+CS_RW+CS_AS+CS_SUSP
CSBAR8$ DC.W RAM2/256+B64K CS8 base & option register values
CSOR8$ DC.W 1*CS_WAIT+CS_BOTHB+CS_R+CS_AS+CS_SUSP
CSBAR9$ DC.W RAM2/256+B64K CS9 base & option register values
CSOR9$ DC.W 0*CS_WAIT+CS_LOWB+CS_W+CS_AS+CS_SUSP
CSBAR10$ DC.W RAM2/256+B64K CS10 base & option register values
CSOR10$ DC.W 0*CS_WAIT+CS_UPPB+CS_W+CS_AS+CS_SUSP
DCB.B 4,FILL.1 <reserved>
* Standby RAM Module
*
.RAMMCR DC.W $FFFF RAM Config. Reg. value
.RAMBAR DC.W $FFFF RAM Base Addr. Reg. value
* NOTE: If Bit0 (RAMDS) of .RAMBAR is set, then Standby RAM Module is not
* programmed, otherwise these two values are read and placed in the
* corresponding registers to program it. This allows the user to
* easily change configurations.
* Periodic Interrupt Timer
* - assumes 32.768 KHz clock
*
.PICR DC.W TIMERLVL<<8+TIMERVEC Periodic int. control reg. value
* . Defines interrupt level & vector.
.PITR DC.W $0102 Periodic int. timing reg. value
* . Defines SYSCALL "tick" = 125 msec
* ROM Auto Boot Vectors
RB_SP DC.L FILL.4 Allocate space for ROM BOOT SP and PC.
RB_PC DC.L FILL.4!1 . PC bit0= 1 disables ROM BOOT!
IFNE 4-(RB_PC-RB_SP)
FAIL 469 ROM BOOT SP/PC not adjacent anymore!
ENDC
* SCI Console Default Initialization Table (CONSCI)
*
CONSCI DS 0 * USE THIS FOR CONNECTION TO TERMINALS
*
******** Each bit set in '.PARMS' below enables the 7 parameters **********
******** that follow. DO NOT ALTER THE VALUE OF '.PARAMS' below! **********
*
.PARMS DC.L $1C0F
*
.BAUD DC.W 9600 Baud rate (in decimal)
.PARITY DC.B 0 Parity: $00= none, 'E'= even, 'O'= odd
.DATA DC.B 8 Nbr. data bits: 7 or 8
.STOP DC.B 1 Nbr. stop bits: 1 or 2
.XON_ENB DC.B $FF XON/XOFF enable:
* . $FF= enabled, $00= disabled
.XON DC.B $11 XON char: ^Q = $11
.XOFF DC.B $13 XOFF char: ^S = $13
*
DCB.B 4,FILL.1 <reserved>
* Power On Branch Vectors
* - There are no entry/exit restrictions for register usage here.
*
PWR_ON:
PWR_INI BRA.L INIT_CS Initialize chip selects, etc. for 68332
* . - returns to PWR_TTL
PWR_TTL BRA.L PWR_TST Print sign on message title.
* . - returns to PWR_TST
* NOTE: PWR_TTL is not enabled yet. Signon message actually gets printed
* in SYSINIT routine via TRAP 15 calls! This may be changed in the
* future so simple SCI routines w/o stack usage can print messages
* until system has been verified (use address regs for return addrs).
*
PWR_TST BRA.L CONFTST Perform confidence tests.
* . - returns to PWR_GO
PWR_GO BRA.L SYSINIT Go start up the system.
* . - never returns
DCB.W 4*3,FILL.2 Reserve space for 4 more BRA.L's (3 words each)
PWR_END EQU *
* System Patch Area
*
SYSPATCH DCB.B $B0,FILL.1 Reserve patch space ($170-* = $B0).
* Sign On Message Test String
*
SIGNON DS.W 0
DC.B SIGN$2-SIGN$1 Set msg byte count
SIGN$1 DC.B CR,LF,LF
SIGN$3 DC.B '332Bug Debugger/Diagnostics - Version 1.02'
SIGN1SZ EQU *-SIGN$3 # chars in line #1 = $2B= 43
DCB.B 36,SPACE Pad to end of line (79-43= 36)
DC.B CR,LF
SIGN$4 DC.B ' (C) Copyright 1989, 1990 by Motorola Inc.'
SIGN2SZ EQU *-SIGN$4 # chars in line #2 = $2A= 42
SIGN3SZ EQU ($200-(SIGNON-ORIGIN))-(*-SIGNON) Extra space= $11 = 17
DCB.B 17,SPACE Pad to end of sigon space
SIGN$2 EQU *
IFNE $200-(*-ORIGIN)
FAIL 470 Param area must= $200 to match user documentation!
ENDC
IFNE $08-(CODESIZE-ORIGIN)
FAIL 471 CODESIZE must= offset $08 to match user documentation!
ENDC
IFNE $0E-(CHECKSUM-ORIGIN)
FAIL 472 CHECKSUM must= offset $0E to match user documentation!
ENDC
IFNE $10-(.CSBAR0-ORIGIN)
FAIL 473 .CSBAR0 must= offset $10 to match user documentation!
ENDC
IFNE $12-(.CSOR0-ORIGIN)
FAIL 474 .CSOR0 must= offset $12 to match user documentation!
ENDC
IFNE $3C-(.CSBARBT-ORIGIN)
FAIL 475 .CSBARBT must= offset $3C to match user documentation!
ENDC
IFNE $3E-(.CSORBT-ORIGIN)
FAIL 476 .CSORBT must= offset $3E to match user documentation!
ENDC
IFNE $40-(CSBAR0$-ORIGIN)
FAIL 477 CSBAR0$ must= offset $40 to match user documentation!
ENDC
IFNE $42-(CSOR0$-ORIGIN)
FAIL 478 CSOR0$ must= offset $42 to match user documentation!
ENDC
IFNE $70-(.RAMMCR-ORIGIN)
FAIL 479 .RAMMCR must= offset $70 to match user documentation!
ENDC
IFNE $72-(.RAMBAR-ORIGIN)
FAIL 480 .RAMBAR must= offset $72 to match user documentation!
ENDC
IFNE $74-(.PICR-ORIGIN)
FAIL 481 .PICR must= offset $74 to match user documentation!
ENDC
IFNE $76-(.PITR-ORIGIN)
FAIL 482 .PITR must= offset $76 to match user documentation!
ENDC
IFNE $78-(RB_SP-ORIGIN)
FAIL 483 RB_SP must= offset $78 to match user documentation!
ENDC
IFNE $7C-(RB_PC-ORIGIN)
FAIL 484 RB_PC must= offset $7C to match user documentation!
ENDC
IFNE $80-(.PARMS-ORIGIN)
FAIL 485 .PARMS must= offset $80 to match user documentation!
ENDC
IFNE $84-(.BAUD-ORIGIN)
FAIL 486 .BAUD must= offset $84 to match user documentation!
ENDC
IFNE $86-(.PARITY-ORIGIN)
FAIL 487 .PARITY must= offset $86 to match user documentation!
ENDC
IFNE $87-(.DATA-ORIGIN)
FAIL 488 .DATA must= offset $87 to match user documentation!
ENDC
IFNE $88-(.STOP-ORIGIN)
FAIL 489 .STOP must= offset $88 to match user documentation!
ENDC
IFNE $89-(.XON_ENB-ORIGIN)
FAIL 490 .XON_ENB must= offset $89 to match user documentation!
ENDC
IFNE $8A-(.XON-ORIGIN)
FAIL 491 .XON must= offset $8A to match user documentation!
ENDC
IFNE $8B-(.XOFF-ORIGIN)
FAIL 492 .XOFF must= offset $8B to match user documentation!
ENDC
IFNE $90-(PWR_ON-ORIGIN)
FAIL 493 PWR_ON must= offset $90 to match user documentation!
ENDC
IFNE $90-(PWR_INI-ORIGIN)
FAIL 494 PWR_INI must= offset $90 to match user documentation!
ENDC
IFNE $96-(PWR_TTL-ORIGIN)
FAIL 495 PWR_TTL must= offset $96 to match user documentation!
ENDC
IFNE $9C-(PWR_TST-ORIGIN)
FAIL 496 PWR_TST must= offset $9C to match user documentation!
ENDC
IFNE $A2-(PWR_GO-ORIGIN)
FAIL 497 PWR_GO must= offset $A2 to match user documentation!
ENDC
IFNE $C0-(SYSPATCH-ORIGIN)
FAIL 498 SYSPATCH must= $C0 to match user documentation!
ENDC
IFNE $170-(SIGNON-ORIGIN)
FAIL 499 SIGNON must= $170 to match user documentation!
ENDC
END